WGT 5.1 Quick Reference ----------------------- WGT5_WC.LIB ----------- unsigned int getmemfree (void) - Returns the number of bytes available to the program. void installkbd (void) - Installs a keyboard handler which permits multiple keypresses at the same time. void * lib2buf (char *filename) - Allocates memory for a file, and loads it into memory. void mdeinit (void) - Removes the custom mouse handler. short minit (void) - Initializes the mouse driver. void moff (void) - Turns off the display of the mouse cursor. void mon (void) - Turns on the display of the mouse cursor. void mouseshape (short x_hotspot, short y_hotspot, unsigned short *mousebitmap) - Sets the bitmap shape and hotpot of the mouse cursor. void msetbounds (short x, short y, short x2, short y2) - Sets the movement boundaries of the mouse cursor. void msetspeed (short x_speed, short y_speed) - Sets the speed of the mouse. void msetthreshhold (short speed) - Sets the speed the mouse must reach before it doubles its movements. void msetxy (short x, short y) - Sets the screen location of the mouse cursor. void noclick (void) - Waits until all buttons are released. void setlib (char *libraryname) - Sets the WGT Data Library name. void setpassword (char *password) - Sets the WGT Data Library password. void uninstallkbd (void) - Removes the WGT custom keyboard handler. void vga256 (void) - Initializes the 320x200x256 VGA/MCGA graphics mode. char vgadetected (void) - Determines if a VGA card is available. block wallocblock (short width, short height) - Allocates enough memory for an image of given dimensions and returns a pointer. void wbar (short x1, short y1, short x2, short y2) - Draws a filled rectangle. void wbezier (tpolypoint *rawpts, short numraw, tpolypoint *curvepts, short numcurve) - Calculates the points of a bezier curve. void wbutt (short x1, short y1, short x2, short y2) - Draws a 3-dimensional button. void wcircle (short x_center, short y_center, short radius) - Draws a circle with a given radius. void wclip (short x1, short y1, short x2, short y2) - Sets the current clipping area for all graphics pages. void wcls (unsigned char col) - Clears the currently select graphics page with a specified color number. void wcolrotate (unsigned char start, unsigned char finish, short dir, color *pal) - Cycles the colors between two indices in a palette. void wcopyscreen (short x1, short y1, short x2, short y2, block source, short destx, short desty, block destination) - Copies a section of one block onto a different block. void wdeinitpoly (void) - Deinitializes the WGT polygon system and frees internal buffers. void wdeinit_triangle_renderer (void) - Deinitializes the WGT triangle rendering system and frees internal buffers. void wdissolve (block sourceimage, short *pattern, short speed) - Dissolves a block onto the active display page, with a user-defined pattern. void wdonetimer (void) - Removes the custom timer interrupt. void wdraw_scanpoly (short x, short y, wscanpoly *scanpoly, void (*customline)(short x1, short x2, short y)) -Draws a concave polygon which was previously scan converted with the wscan_convertpoly routine. void wellipse (short x_center, short y_center, short x_radius, short y_radius) - Draws a hollow ellipse. void wfade_between (unsigned char start, unsigned char finish, short speed, color *pal1, color *pal2) - Gradually fades in a group of colors from one palette to another palette using the specified speed. void wfade_between_once (unsigned char start, unsigned char finish, color *pal1, color *pal2) - Fades in a group of colors from one palette to another, performing only 1/64th of the fade operation. void wfade_in (unsigned char start, unsigned char finish, short speed, color *pal) - Gradually fades in a group of colors from black to a palette variable using a specified speed. void wfade_in_once (unsigned char start, unsigned char finish, color *pal, color *temppal) - Fades in a group of colors from black to a palette variable, performing only 1/64th of the fade operation. void wfade_out (unsigned char start, unsigned char finish, short speed, color *pal) - Gradually fades a group of colors from a palette variable to black, using a specified speed. void wfade_out_once (unsigned char start, unsigned char finish, color *pal) - Fades out a group of colors from a palette variable to black, performing only 1/64th of the fade operation. void wfastputpixel (short x, short y) - Plots a pixel at the given screen coordinate without clipping. void wfill_circle (short x_center, short y_center, short radius) - Draws a filled circle given a center and radius. void wfill_ellipse (short x_center, short y_center, short x_radius, short y_radius) - Draws a filled ellipse given a center, a horizontal radius, and a vertical radius. void wflashcursor (void) - Flash the cursor using the values set by wsetcursor and the global variable curspeed. void wfline (short x1, short y1, short x2, short y2) - Draws a line between two points, without clipping. void wflipblock (block image, short direction) - Flips a block in one of two directions. The block is physically changed in memory, not on the screen. void wfree_scanpoly (wscanpoly *scanpoly) - Frees memory used by a polygon buffer. void wfreeblock (block image) - Releases memory used to store an image. void wfreefont (wgtfont font) - Frees memory previously allocated for a font. void wfreesprites (block *image_array, short start, short end) - Frees memory from an array of blocks. short wget_capslock (void) - Returns the state of the Capslock key. unsigned char wget_imagebit (block image) - Retrieves a byte of information from the end of allocated memory from an image. unsigned char wget_imagebyte (block image) - Retrieves a byte of information from the end of allocated memory from an image. short wget_lalt (void) - Returns the state of the left Alt key. short wget_lctrl (void) - Returns the state of the Left Control key. short wget_lshift (void) - Returns the state of the Left Shift key. short wget_numlock (void) - Returns the state of the Numlock key. short wget_ralt (void) - Returns the state of the Right Alt key. short wget_rctrl (void) - Returns the state of the Right Control key. short wget_rshift (void) - Returns the state of the Right Shift key. short wget_scrlock (void) - Returns the state of the Scroll Lock key. short wgetblockheight (block image) - Returns height of a previously stored block. short wgetblockwidth (block image) - Returns width of a previously stored block. short wgetmode (void) - Returns the current video mode number. unsigned char wgetpixel (short x, short y) - Gets the pixel value at the given screen coordinate. short wgettextheight (char *string, wgtfont font) - Returns the maximum height of the string. short wgettextwidth (char *string, wgtfont font) - Returns the width of the string. void wgouraudpoly (tpolypoint *vertexlist, short numvertex, short x, short y) - Draws a Gouraud shaded convex polygon. void wgtprintf (short x, short y, wgtfont font, char *fmt, ... ) - Prints text using the standard printf format. void whline (short x1, short x2, short y) - Draws a horizontal line between two points. void whollowpoly (tpolypoint *vertexlist, short numvertex, short x, short y, short closemode) - Draws a hollow polygon. void winitpoly (short maxrows) - Initializes the WGT polygon system to a maximum number of scanlines. void winittimer (void) - Installs the custom timer interrupt. void winit_triangle_renderer (short maxrows) - Initializes the WGT triangle rendering system to a maximum number of scanlines. void wline (short x1, short y1, short x2, short y2) - Draws a line between two points. block wloadblock (char *filename) - Loads a block file from disk into memory. block wloadbmp (char *filename, color *pal) - Loads a BMP image and converts it into block format. block wloadcel (char *filename, color *pal) - Loads a CEL file (Autodesk Animator format) from dsik into memory. wgtfont wloadfont (char *filename) - Loads a bitmapped font from disk and returns a pointer to it. block wloadiff (char *filename, color *pal) - Loads an Amiga IFF/LBM format image and its associated palette. block wloadpak (char *filename) - Loads a compressed PAK file from disk into memory. void wloadpalette (char *filename, color *pal) - Loads a palette from disk into a palette variable. block wloadpcx (char *filename, color *pal) - Loads a PCX file from disk into memory. short wloadsprites (color *pal, char *filename, block *image_array, short start, short end) - Loads a sprite file. block wnewblock (short x1, short y1, short x2, short y2) - Captures a section of the screen into a block. void wnormscreen (void) - Sets the active page back to the original visual page. void wouttextxy (short x, short y, wgtfont font, char *string) - Outputs a string of text. void wpan (unsigned short pan_offset) - Changes the offset of the visual screen. void wputblock (short x, short y, block image, short method) - Displays a block onto the current graphics page. void wputblock_shade (short x, short y, block image, block shadetable, int mode) - Draws a block onto the current graphics page, using a shade table. void wputpixel (short x, short y) - Plots a pixel at the given screen coordinate. void wreadpalette (unsigned char start, unsigned char finish, color *pal) - Reads the current palette into a palette variable. void wrectangle (short x1, short y1, short x2, short y2) - Draws a rectangle using the current color and graphics page. void wregionfill (short x, short y) - Fills an area of the screen bounded by any color. void wremap (color *pal1, block image, color *pal2) - Remaps the colors of a block or the visual screen to a new palette. void wresize (int x1, int y1, int x2, int y2, block image, short mode) - Draws a previously stored image on the screen to fit within a given boundary. void wresize_column (int x, int y, int y2, block image, short column, short mode) - Resizes a single column of a bitmap to a new height on the screen. void wresize_shade (short x1, short y1, short x2, short y2, block image, unsigned char *shadetable, short mode) - Draws a previously stored image on the screen to fit within a given boundary, using a shade table. void wretrace (void) -Waits for the vertical retrace. short wsaveblock (char *filename, block image) - Saves a block to a disk file in raw format. short wsavebmp (char *filename, block image, color *pal) - Saves a block image to disk in BMP format. short wsavecel (char *filename, block image, color *pal) - Saves a CEL file (Autodesk Animator format) to disk. short wsavepak (char *filename, block image) - Saves a block to disk in compressed format. void wsavepalette (char *filename, color *pal) - Save a palette variable's contents to a file. short wsavepcx (char *filename, block image, color *pal) - Saves a block to disk in the PCX compressed format. short wsavesprites (color *pal, char *filename, block *image_array, short start, short end) - Saves a sprite file using a palette array and a set of blocks. void wscan_convertpoly (tpolypoint *vertexlist, short numvertex, wscanpoly *scanpoly) - Scan converts a concave polygon into a rendered polygon buffer. void wset_capslock (short state) - Sets the state of the capslock key. void wset_imagebyte (block image, unsigned char status) - Stores a byte of information at the end of allocated memory for an image. void wset_numlock (short state) - Sets the state of the numlock key. void wset_scrlock (short state) - Sets the state of the scroll lock key. void wsetcolor (unsigned char col) - Sets the current drawing color. void wsetcursor (short start, short end) - Sets the shape of the software emulated text cursor. void wsetmode (short mode) - Sets the video mode. void wsetpalette (unsigned char start, unsigned char finish, color *pal) - Sets a group of colors from a specified palette variable. void wsetrgb (unsigned char num, unsigned char red, unsigned char green, unsigned char blue, color *pal) - Sets a color's red, green, and blue values. void wsetscreen (block image) - Makes all drawing procedures use a specified destination video buffer. void wsettimerspeed (int speed) - Sets the custom timer interrupt to run at a different speed. void wskew (short x, short y, block image, short degrees) - Skews a block sideways. void wsline (short x1, short y1, short x2, short y2, short *y_array) - Stores the points of a line into an array instead of plotting them on the screen. void wsolidpoly(tpolypoint *vertexlist, short numvertex, short x, short y, void (*customline)(short x1, short x2, short y)) - Draws a filled convex polygon. void wstarttimer (wtimerproc timer, int speed) - Installs a custom timer interrupt at the given speed. void wstoptimer (void) - Resets a custom timer interrupt to an empty procedure. void wstring (short x, short y, char *string, char *legal, short maxlength) - Reads in a string of text from the keyboard and displays both the text and a simulated cursor on the graphics page. void wstyleline (short x, short y, short x2, short y2, unsigned short style) - Draws a line from between two points with a line pattern. void wtextbackground (unsigned char col) - Sets the background text color. void wtextcolor (unsigned char col) - Selects the foreground character color. void wtextgrid (short state) - Switches the text coordinate system between character and pixel based. void wtexttransparent (short mode) - Sets text output to suppress the display of the foregound or background. void wtexturedpoly (tpolypoint *vertexlist, short numvertex, short x, short y, block image, short mode) - Draws a texture mapped convex polygon. void wtriangle_flat_shaded_texture (tpoint *ttri, block texture, short shade, block shadetable) - Draws a flat shaded texture mapped triangle. void wtriangle_gouraud (tpoint *gtri) - Draws a Gouraud shaded triangle. void wtriangle_gouraud_shaded_texture (tpoint *ttri, block texture, block shadetable) - Draws a Gouraud shaded texture mapped triangle. void wtriangle_solid (tpoint *ftri) - Draws a filled triangle. void wtriangle_texture (tpoint *ttri, block texture) - Draws a texture mapped triangle. void wtriangle_translucent_gouraud (tpoint *gtri, block shadetable) - Draws a translucent Gouraud shaded triangle. void wtriangle_translucent_texture (tpoint *ttri, block texture, block shadetable) - Draws a translucent texture mapped triangle. void wupdate_imagebytes (block *image_array, short start, short end) - Updates status bytes for an array of images. void wvertres (short x1, short y1, short y2, block image) - Draws a previously stored image on the screen to fit within a given boundary but only stretches it vertically. void wwarp (short x1, short x2, short *top, short *bot, block image, int mode) - Displays a block on the screen, using different heights for each column displayed. void wwipe (short x1, short y1, short x2, short y2, block image) - Draws a line but uses colors from another virtual screen. void wxorbox (short x, short y, short x2, short y2, unsigned char col) - Draws a filled rectangle using exlusive-or mode. char *wfilesel (char *mask, char *title, short x, short y, block background) - Activates the WGT file selector routine. WJOY_WC.LIB ----------- short wcalibratejoystick (joystick *joy) - Finds out the coordinate range of the joystick. short wcheckjoystick (void) - Determines which joysticks are connected. void winitjoystick (joystick *joy, short joynum) - Initializes a joystick. short wreadjoystick (joystick *joy) - Reads the information from a joystick. WGT3D_WC.LIB ------------ void winit3d (void) - Initializes the WGT 3D system. void wrotatepoints (point3d *orig_pointlist, point3d *rotated_pointlist, short maxpoint) - Rotates a set of three dimensional points. void wsetrotation (short rotate_x, short rotate_y, short rotate_z) - Sets the rotational amount in each axis that all points will be rotated by. WSCR_WC.LIB ----------- short is_in_window (short currentwindow, short x, short y, short range) - Determines if the coordinate given is inside the scrolling window. short soverlap (short s1, scrollsprite *wobjects1, block *sprites1, short s2, scrollsprite *wobjects2, block *sprites2) - Detects collisions between two scrollsprites. void wcopymap (short sourcewindow, short destwindow) - Makes a scrolling window share a map with another window. void wendscroll (short currentwindow) - Releases memory used for a scrolling window. void wfreemap (wgtmap mapname) - Releases memory used to store a map file. unsigned short wgetworldblock (short currentwindow, short posx, short posy) - Returns the tile number at the given location in a map. unsigned char wgetworldpixel (short currentwindow, short x, short y) - Returns the color of a pixel within a map. void winitscroll (short currentwindow, short mode, short link, short windowwidth, short windowheight, block *tileref) - Initializes one of the four scrolling windows. wgtmap wloadmap (short currentwindow, char *filename, short *tiletypes, scrollsprite *wobjects) - Loads a tiled map into a scrolling window. void wputworldblock (short currentwindow, short posx, short posy, unsigned short tilenum) - Changes the tile number at the given location on a map. void wsavemap (short currentwindow, char *filename, wgtmap savemap, short *tiletypes, scrollsprite *wobjects, short numobj) - Saves a WGT map stored in memory into a file. short wscreen_coordx (short currentwindow, short xcoord) - Returns the absolute X screen coordinate of a world coordinate. short wscreen_coordy (short currentwindow, short ycoord) - Returns the absolute Y screen coordinate of a world coordinate. void wscrollwindow (short currentwindow, short windowspeedx, short windowspeedy) - Scrolls a window by a distance vertically and horizontally. void wshowobjects (short currentwindow, short start, short end, block *image_array, scrollsprite *wobjects) - Displays a range of scrollsprites on the scrolling window. void wshowwindow (short currentwindow, short posx, short posy) - Sets the location of the world within a scrolling window. WMENU_WC.LIB ------------ short checkmenu (void) - Polls the mouse until the user clicks a button, and returns which menu choice was selected. void initdropdowns (void) - Initializes the drop down menu system. void removemenubar (void) - Turns off the menu bar at the top of the screen. void showmenubar (void) - Displays the menu bar at the top of the screen. WSPR_WC.LIB ----------- void animate (short spritenum, char *animation_sequence) - Sets the animation sequence for a sprite. void animoff (short spritenum) - Freezes animation for the sprite. void animon (short spritenum) - Turns animation on for a sprite. void deinitialize_sprites (void) - Deinitializes the sprite system. void draw_sprites (int movement_multiplier) - Draws the sprites and updates movement and animation counters. void erase_sprites (void) - Erases the sprites from the screen. void initialize_sprites (block *sprite_blocks) - Initializes the sprite library. void movex (short spritenum, char *movement_sequence) - Sets the horizontal movement of a sprite. void movexoff (short spritenum) - Turns horizontal movement for a sprite off. void movexon (short spritenum) - Turns horizontal movement for a sprite on. void movey (short spritenum, char *movement_sequence) - Sets the vertical movement of a sprite. void moveyoff (short spritenum) - Turns vertical movement for a sprite off. void moveyon (short spritenum) - Turns vertical movement for a sprite on. short overlap (short spritenum_1, short spritenum_2) - Tests if two sprites overlap each other on the screen. void spriteoff (short spritenum) - Turns off a sprite. void spriteon (short spritenum, short xcoord, short ycoord, short arrnumber) - Turns a sprite on at the given location. WFLIC_WC.LIB ------------ int openflic (char *filename, int mode_flic, int update_colors) - Opens a FLI or FLC animation file to be played. int nextframe (void) - Advances an open animation file to the next frame. void copyflic (void) - Copies the animation buffer to the visual screen. void closeflic (void) - Closes a previously opened animation file. WVESA_WC.LIB ------------ short wvesa_bank (short bank) - Switches to a different bank on a SVGA card. short wvesa_detected (void) - Returns 1 if a VESA (SVGA) driver is detected. short wvesa_getmodeinfo (short mode) - Stores video mode information in the VESAmode global structure. short wvesa_init (short mode) - Initializes a SVGA video mode using a VESA driver. void wvesa_setlogical (unsigned short startline) - Sets the logical scanline to write to in the SVGA memory system. This can be larger than the physical screen dimensions. void wvesa_setphysical (unsigned short left, unsigned short startline) - Sets the physical screen display region. The leftmost pixel displayed and the starting scanline are parameters. Useful for page flipping techniques. short wvesa_setwidth (unsigned short width) - Sets the logical SVGA screen width. short wvesa_supported (short mode) - Returns status of VESA and video card support for a given SVGA video mode. Duplicates from WGT5_WC.LIB, but in SVGA: void wvesa_clip (short x, short y, short x2, short y2) void wvesa_cls (short color) void wvesa_putpixel (short x, short y) int wvesa_getpixel (short x, short y) void wvesa_line (short x, short y, short x2, short y2) void wvesa_hline (short x, short y, short x2) void wvesa_bar (short x, short y, short x2, short y2) void wvesa_rectangle (short x, short y, short x2, short y2) void wvesa_copyscreen (short sx, short sy, short sx2, short sy2, block src, short dx, short dy, short method) block wvesa_newblock (short sx, short sy, short sx2, short sy2) void wvesa_putblock (short dx, short dy, block src, short method) void wvesa_outtextxy (short x, short y, wgtfont fnt, char *printit) void wvesa_xorline (short x, short x2, short y) WCOMM_WC.LIB ------------ int wlink_answer(void) - Waits for a call, and connects when a ring occurs. int wlink_dial(char *dialstring) - Dials a number. void wlink_flush_incoming(void) - Flushes the incoming communications buffer. void wlink_flush_outgoing(void) - Flushes the outgoing communications buffer. void wlink_get_uart(void) - Finds out what kind of UART is present. void wlink_getvector(void) - Finds out which interrupt vector to use for communications. void wlink_hangup_modem(void) - Sens the hangup string to the modem. int wlink_initmodem(void) - Sends the modem initialization string. void wlink_initport(void) - Initializes a communications session. void wlink_modemcommand(char *str) - Sends a command to the modem. int wlink_modemresponse(char *resp) - Reads a response from the modem. short wlink_read_byte(void) - Reads a single byte from the incoming data buffer. void wlink_shutdownport(void) - Closes a communications session. void wlink_write_buffer(char *buffer, unsigned int count) - Sends a number of bytes over the communications link.